import java.io.*;  
import java.awt.event.*;  
import javax.swing.*;  
public class miniclicker {  
public static void main(String[] args) {  
JFrame f=new JFrame();//creating instance of JFrame  
          
JButton b=new JButton("Click");//creating instance of JButton  
b.setBounds(45,50,100, 40);//x axis, y axis, width, height  
JLabel l1;  
l1=new JLabel("Clicks: 0");  
l1.setBounds(45, 90, 100, 20);
JButton b1=new JButton("Start Timer");//creating instance of JButton  
b1.setBounds(45,110,100, 20);//x axis, y axis, width, height  
          
f.add(b);//adding button in JFrame  
f.add(b1);//adding button in JFrame 
f.add(l1);//adding button in JFrame
          
f.setSize(200,200);//400 width and 500 height  
f.setLayout(null);//using no layout managers  
f.setVisible(true);//making the frame visible  


b.addActionListener(new ActionListener(){
    int count = 0;  
    public void actionPerformed(ActionEvent e){  
        count++;
        l1.setText("Clicks: " + count);  
    }  
    
    });

    b1.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){  
                String anyCommand="start timer.bat";
                try {
                    Runtime.getRuntime().exec("cmd /c start cmd.exe /K " + anyCommand);
            
                } catch (IOException ee) {
                    ee.printStackTrace();
                }
            }  
        
        });
}  
}  